highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
I need help adding lines of script to an item that is equipped by the PC that will make the item go back into his inventory after a certain amount of time.
What I'm doing is I made a Helm that allows my vampire to be a daywalker, but I only want him to be able to wear the helm for 6-7 daylight hours, and when the time is up the helm goes back into the inventory and cannot be worn again until the set hours of daylight.
I've been reading SFD by Ghan, and have everything else working up to this point, but now I'm just lost. In other words, I just can't figure out how to do the above. I've been trying since yesterday, and didn't really want to bother anyone here, but now I need help!
Anyone who can help I would really appreciate it. Thanks in advance!
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Post Extras:
|
highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
Well maybe I can get some help if I display what I already have. Here is the script. I just need to know how and where to but what I need help with as described above.
begin _vampire_Dome
short OnPCEquip short ItemEquipped
if ( OnPCEquip == 1 )
if ( MenuMode == 1 ) return else If (PCVampire == 1 ) if ( ItemEquipped == 0 ) FadeOut, 0.25 MessageBox "You can now walk beneath the sun's rays with no fear of pain" Player-> RemoveSpell "Vampire sun damage" set ItemEquipped to 1 FadeIn, 5 endif endif endif else if ( MenuMode == 1 ) return else if ( ItemEquipped == 1 ) FadeOut, 0.25 MessageBox " Beware! The sun's rays will now scorch you" Player-> AddSpell "Vampire sun damage" set ItemEquipped to 0 FadeIn, 5 endif endif endif end
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Post Extras:
|
sisco
|
Curate
|
|
|
Reged: 02/13/03
|
Posts: 463
|
|
|
|
This should work.
Code:
begin _vampire_Dome
short OnPCEquip short ItemEquipped short ItemUnequipTime
if ( OnPCEquip == 1 )
if ( MenuMode == 1 ) return else If (PCVampire == 1 ) if ( ItemEquipped == 0 ) set ItemUnequipTime to ( GameHour + 6 ) ; can change number to however many hours you want FadeOut, 0.25 MessageBox "You can now walk beneath the sun's rays with no fear of pain" Player-> RemoveSpell "Vampire sun damage" set ItemEquipped to 1 FadeIn, 5 endif endif endif else if ( MenuMode == 1 ) return else if ( GameHour >= ItemUnequipTime ) if ( ItemEquipped == 1 ) FadeOut, 0.25 MessageBox " Beware! The sun's rays will now scorch you" Player-> AddSpell "Vampire sun damage" set ItemEquipped to 0 set ItemUnequipTime to 0 FadeIn, 5 endif endif endif endif end
-------------------- my site
Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.
Post Extras:
|
highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
sisco....A BIG THANK YOU!
I just knew if I waited it out the MW community would come through. As small as that line is, to a novice trying to learn this is huge. Again thank you soooo much!
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Post Extras:
|
highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
Well it didn't work afterall, but I did learn something here and that's very good. I know that I'm closer than I was before. Would I need to use a PCSkipEquip command anywhere to get this to work?
Anyone? Please!
Thanks again for the help sisco. Believe it, or not I gained some much need scripting knowledge with that small amount of info.
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Post Extras:
|
slacker007
|
Acolyte
|
|
|
Reged: 06/05/04
|
Posts: 119
|
Loc: USA, MS
|
|
|
I don't do much scripting, so im really taking a stab here, but u sound desperate. It seems to me like you want it only to be worn from 6am to 6pm, so if you do you would probably need to say something like if gametime<6 or >18 then (insert the command to unequip the item here).
There. Thats my ingenious idea. Hope it works
-------------------- --------------------
Cogito ergo sum. -Descartes
(I think therefore I am)
Mediocrity:
It takes alot less time and most people don't notice until its too late
-2004 Dispair Calendar
DON'T CONFORM TO ANTI-CONFORMATISM, JUST BE YOURSELF!
Post Extras:
|
highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
I will give that a try. Thanks...any & all help is appreciated!
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Post Extras:
|
Miles_Acraeus
|
Master
|
|
|
Reged: 08/24/02
|
Posts: 7891
|
Loc: Primum Mobile
|
|
|
Well this post is more or less just giving your thread a bump, since this script I just wrote doesn't work. What needs to be done it seems is record the gameHour at the time of equip, and track that over 5-6 hours. Since I don't have any clue as to how to do this, hopefully my post will attract the attention of an experienced scripter to point out my folly, and give you a more difinitive answer.
Code:
Begin AST_Test_Equip
;adjust gameHour if required
Short Temp_Equip
Short OnPcEquip
Short PcSkipEquip
Short Equip_Time
if ( MenuMode == 1 )
return
endif
If ( OnPcEquip == 1 )
set Temp_Equip to 10
set OnPcEquip to 0
endif
if ( Temp_Equip == 10 )
if ( GameHour >= 19 )
if ( GameHour <= 7 )
set PcSkipEquip to 1
MessageBox, "You can't equip this at night."
return
endif
elseif ( GameHour > 7 )
if ( GameHour < 19 )
set Temp_Equip to 20
set OnPcEquip to 0
if ( Temp_Equip == 30 )
set PcSkipEquip to 1
MessageBox, "You can only use this once per day."
endif
endif
endif
endif
if ( Temp_Equip == 20 )
if ( Equip_Time == 0 )
MessageBox, "You Have six hours to wear this item."
set Equip_Time to ( Equip_Time + Gamehour )
elseif ( Equip_Time == ( GameHour + 5 ) )
MessageBox, "Your time has expired."
set PcSkipEquip to 1
set Temp_Equip to 30
endif
endif
end
Of course I only get the message, "You have six hours to wear this item.", with a "rightEval" error, and nothing further happening. Hell, it didn't even recognize the gameHour when I tried to equip it at 11:00 PM.
Someone help this guy out!
-------------------- "Just some spittle in your face." ~ Vladimir Harkonnen
Post Extras:
|
sisco
|
Curate
|
|
|
Reged: 02/13/03
|
Posts: 463
|
|
|
|
I just altered my script a bit more and just about got it working.
Code:
begin cs_vampire_Dome
short OnPCEquip short ItemEquipped short ItemUnequipTime
if ( OnPCEquip == 1 )
if ( MenuMode == 1 ) return endif If (PCVampire == 0 ) ; i set this to 0 because i wasn't a vampire when i tested if ( ItemEquipped == 0 ) set ItemUnequipTime to ( GameHour + 1 ) ; can change number to however many hours you want MessageBox, "at %g ItemUnequipTime set to %g", GameHour, ItemUnequipTime ; for some reason this didn't display FadeOut, 0.25 MessageBox "You can now walk beneath the sun's rays with no fear of pain" ; but this did set ItemEquipped to 1 MessageBox, "Item Equiped" Player-> RemoveSpell "Vampire sun damage" MessageBox, "Spell Removed" FadeIn, 5 endif endif if ( GameHour >= ItemUnequipTime ) MessageBox, "Time to Uneguip" if ( ItemEquipped == 1 ) ;need to add something to unequip the helmet. maybe If you set PCSkipEquip to 1 here the player will unequip it? I'll try it. FadeOut, 0.25 MessageBox " Beware! The sun's rays will now scorch you" Player-> AddSpell "Vampire sun damage" MessageBox, "Spell Added" set ItemEquipped to 0 set ItemUnequipTime to 0 FadeIn, 5 endif endif endif
end
-------------------- my site
Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.
Post Extras:
|
sisco
|
Curate
|
|
|
Reged: 02/13/03
|
Posts: 463
|
|
|
|
It works now.
Code:
begin cs_vampire_Dome
short OnPCEquip short ItemEquipped short ItemUnequipTime Short nextDay Short Done short DoOnce
If ( DoOnce == 0 ) set nextDay to Day set DoOnce to 1 endif
If ( Day == nextDay ) set Done to 0 EndIf
if ( Done == 0 ) if ( OnPCEquip == 1 )
if ( MenuMode == 1 ) return endif If (PCVampire == 1 ) if ( ItemEquipped == 0 ) set ItemUnequipTime to ( GameHour + 6 ) ; can change number to however many hours you want set nextDay to ( Day + 1 ) ; so it can only be used once per day. you can change this so it can be used everyother day or whatever. FadeOut, 0.25 MessageBox, "You can now walk beneath the sun's rays with no fear of pain" Player-> RemoveSpell "Vampire sun damage" set ItemEquipped to 1 FadeIn, 5 endif endif if ( GameHour >= ItemUnequipTime ) if ( ItemEquipped == 1 ) FadeOut, 0.25 MessageBox " Beware! The sun's rays will now scorch you" Player-> AddSpell "Vampire sun damage" set ItemEquipped to 0 set ItemUnequipTime to 0 set Done to 1 FadeIn, 5 endif endif endif endif
end
-------------------- my site
Me and my friends need more active members on our forums. it's not morrowind related. just a place for total randomness. Come join and post a lot.
Post Extras:
|
highpressure
|
Curate
|
|
|
Reged: 09/16/02
|
Posts: 870
|
Loc: Traversing the Spiritual Plane seeking the wisdom of the Higher Power.
|
|
|
Sisco my many thanks! To everyone that gave a helping hand with suggestions, I really appreciate it!
I've been at it all day trying to learn this. Now with all the help and info that I got here, I just got a little smarter. This was my first attempt at something with more than 10 lines of script hehehe! so I was a little overwhelmed at first, but refused to give up!
Thanks again for all of the support!
P.S.
Is there a command to damage the item maybe, in order for it to go back into the PC's inventory once the time runs out? Then once it's in the inventory restore the health/condition of said item, and add a PCSkipEquip line so that it can't be equipped until the next morning.
-------------------- Highpressure's Morrowind
Honoring Mods & Mod-Makers
Edited by highpressure (08/08/04 12:36 AM)
Post Extras:
|